package com.evenmo.hrms.controller.hrmsControllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @ClassName LoginController
 * @Description TODO
 * @Author moyongjun
 * @Date 2022/4/5 12:04
 * @Version 1.0
 **/
@Controller
public class LoginController {
    @GetMapping("/login")
    public String toLogin() {
        return "login";
    }

    @PostMapping("/login")
    @ResponseBody
    public String login(String username, String password) {
        System.out.println("useranme:" + username);
        System.out.println("password:" + password);


        System.out.println("登录成功！");
        return "index";
    }

    @GetMapping("/unauth")
    public String unauth() {
        return "error/unauth";
    }

    @GetMapping("/register")
    public String register() {
        return "register";
    }
}
